package com.bpm.example.event.error;

import com.bpm.common.util.FlowableEngineUtil;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.eventsubscription.api.EventSubscription;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery;
import org.junit.Test;

/**
 * 错误边界事件示例流程
 */
@Slf4j
public class RunErrorBoundaryEventProcessDemo extends FlowableEngineUtil {
    @Test
    public void runSignalBoundaryEventProcessDemo() throws Exception {
        //加载Flowable配置文件并初始化流程引擎及服务
        initFlowableEngineAndServices("flowable.cfg.xml");
        //部署流程
        ProcessDefinition procDef
                = deployResource("processes/error/ErrorBoundaryEventProcess.bpmn20.xml");

        //启动流程实例,进入任务一
        ProcessInstance procInst = runtimeService.startProcessInstanceById(procDef.getId());
    }
}
